<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center addProject_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub addProject_fd0_0'>
          <view class='flex flex-wrap align-center addProject_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  addProject_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='addProject_fd0_0_c1_c0'>添加产品</text>
          </view>
          <view class='flex flex-wrap align-center justify-end addProject_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-wrap align-center justify-between addProject_fd1_0'>
          <text>产品名称</text>
          <benben-input class='addProject_fd1_0_c1' type="text" :placeholder="`请输入`" confirm-type="done" :maxlength="10"
            v-model="name" :adjust-position='true' placeholder-style="color:#999;font-size:28rpx" />
        </view>
        <view class='flex flex-wrap align-center justify-between addProject_fd1_1'>
          <text>产品图片</text>
          <benben-image-upload :path.sync="thumb" :img-id.sync="thumb" :is-cropping="false" :is-show-clean="true"
            class="upload position-relative">
            <text v-if="thumb != ''" data-type="clean"
              class='fu-iconfont2 position-absolute addProject_fd1_1_c1_icon'>&#xE8E7;</text>
            <image class=" addProject_fd1_1_c1_image" mode="aspectFill" :src="thumb ? thumb : STATIC_URL+'178.jpg'">
            </image>
          </benben-image-upload>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch justify-between qiyeInfo_fd1_4'>
          <text>产品介绍</text>
          <view class='flex flex-wrap qiyeInfo_fd1_4_c1'>
            <textarea class='flex qiyeInfo_input_fd1_3_c1' :placeholder="'请输入'" :adjust-position='true' :maxlength="240"
              :show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="jieshao" />
            <template>
              <view class='flex flex justify-end qiyeInfo_numberfd1_3_c1_c0'>
                <text>{{jieshao.length}}</text>
                <text>/</text>
                <text>240</text>
              </view>
            </template>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center addProject_flex_2" @click.stop="submit">
        <button class='addProject_fd2_0'>提交</button>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </page-body>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        "name": "",
        "thumb": "",
        jieshao: ''
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      submit() {
        if (!this.name) {
          this.$message.info('请输入产品名称')
          return
        }
        if (!this.thumb) {
          this.$message.info('请上传产品图像')
          return
        }
        let obj = {
          name: this.name,

          thumb: this.thumb,
          jieshao: this.jieshao
        }
        uni.$emit('product', obj)
        uni.navigateBack()
      }
    }
  };
</script>
<style lang="scss" scoped>
  .qiyeInfo_numberfd1_3_c1_c0 {
    width: 100%;
    font-size: 24rpx;
    color: #FFFFFF;
    line-height: 46rpx;
    font-weight: 400;
  }

  .qiyeInfo_fd1_4_c1 {
    background: #F8F9FD;
    width: 686rpx;
    border-radius: 10rpx;
    padding: 10rpx 10rpx 0rpx 16rpx;
    margin: 24rpx auto 0rpx auto;
  }

  .qiyeInfo_fd1_4 {
    border-bottom: 1px solid #eee;
    padding: 32rpx 0rpx 32rpx 0rpx;
    margin: 0rpx auto 0rpx auto;
    width: 686rpx;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .addProject_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .addProject_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .addProject_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .addProject_fd0_0_c0 {
    width: 120rpx;
  }

  .addProject_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .addProject_fd1_1_c1_image {
    width: 164rpx;
    height: 127rpx;
  }

  .addProject_fd1_1_c1_icon {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .addProject_fd1_1 {
    width: 702rpx;
    margin: 32rpx auto 32rpx auto;
  }

  .addProject_fd1_0_c1 {
    text-align: right;
  }

  .addProject_fd1_0 {
    border-bottom: 1px solid #eee;
    line-height: 90rpx;
    height: 90rpx;
    width: 702rpx;
    margin: 0rpx auto 0rpx auto;
  }

  .addProject_flex_2 {
    width: 308rpx;
    height: 80rpx;
    border-radius: 44rpx;
    position: fixed;
    bottom: calc(100rpx + var(--window-bottom));
    left: 200rpx;
  }

  .addProject_fd2_0 {
    background: var(--benbenbgColor2);
    border-radius: 44rpx;
    width: 500rpx;
    line-height: 80rpx;
    font-size: 32rpx;
    color: #fff;
    height: 80rpx;
  }
</style>
